#ifndef USER_H
#define USER_H

#include <QObject>
#include <QtDebug>
#include "custom.h"
#include<string>

class user:public QObject
{
    Q_OBJECT
        Q_PROPERTY(QString Name READ Name WRITE setName NOTIFY NameChanged)
        Q_PROPERTY(int Age READ Age WRITE setAge NOTIFY AgeChanged)
        Q_PROPERTY(QString SubLength READ SubLength WRITE setSubLength NOTIFY SubLengthChanged)
        Q_PROPERTY(QString Password READ Password WRITE setPassword NOTIFY PasswordChanged)
        Q_PROPERTY(QString Message READ Message WRITE setMessage NOTIFY MessageChanged)
    public:
        user();
        user(QString name,int age,QString sublength,QString password);

        QString Name();
        void setName(QString name);

        int Age();
        void setAge(int age);

        void setSubLength(QString  str);
        QString SubLength();

        void setPassword(QString pass);
        QString Password();

        QString Message();
        void setMessage(QString message);

    signals:
        void NameChanged();
        void AgeChanged();
        void SubLengthChanged();
        void MessageChanged();
        void PasswordChanged();
    public slots:
    void editOk();

    /***
     * @author: wudl
     * @desc:
     *  检查用户密码是否正确
     *
     * */
    bool checkPass();

    private :
        QString m_name;
        int m_age;
        QString m_password;
        QString m_subLength;
        QString m_message;
};

#endif // USER_H
